package tech.cn.note.utils;

import org.apache.commons.lang3.StringUtils;

public class CheckUtil {
    public static void checkNotBlank(String src, String errorMsg) {
        if (StringUtils.isBlank(src)) {
            throw new RuntimeException(errorMsg);
        }
    }

    public static void checkNotNull(Object src, String errorMsg) {
        if (src == null) {
            throw new RuntimeException(errorMsg);
        }
    }

    public static void checkExpression(boolean src, String errorMsg) {
        if (!src) {
            throw new RuntimeException(errorMsg);
        }
    }
}
